package bma.common.netty.framereader;

import org.jboss.netty.buffer.ChannelBuffer;

/**
 * 帧读取器
 * 
 * @author guanzhong
 * 
 * @param <CTX_TYPE>
 */
public interface FrameReader<CTX_TYPE> {

	public enum RESULT {
		NOT_DONE, AGAIN, DONE, END
	}

	/**
	 * 读取数据
	 * 
	 * @param buffer
	 * @param ctx
	 * @return
	 * @throws Exception
	 */
	public RESULT process(ChannelBuffer buffer, CTX_TYPE ctx) throws Exception;
}
